package com.czmh.etc.onlinepubsys.exceptions;

import com.czmh.etc.onlinepubsys.enums.cmg.ApiCodeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 招商局ETC新系统平台-api异常对象
 */
@ApiModel("招商局ETC新系统平台-api异常对象")
@Data
public class ApiCodeException extends RuntimeException {
    @ApiModelProperty("编码值")
    private Object code;

    public ApiCodeException(String message) {
        super(message);
    }

    public ApiCodeException(Object code, String message) {
        super(message);
        this.code = code;
    }

    public ApiCodeException(ApiCodeEnum apiCodeEnum) {
        super(apiCodeEnum.getDesc());
        this.code = apiCodeEnum.getCode();
    }

    public ApiCodeException(Throwable cause) {
        super(cause);
    }

    public ApiCodeException(Throwable cause, Object code) {
        super(cause);
        this.code = code;
    }
}
